How to: Add a subform to a form.
Solution:
In the Form Design view, use the 'Subform/Subreport' on the Toolbox. Click on the form to insert a subform and follow the steps for the wizard.
1) If the Database window is not activated, activate the Database window.
2) Click the 'Forms' tab in the Database window.
Forms tab
3) Select the desired main form from the list box. (The selected form is highlighted.)
NOTE: Before proceeding, the table relationships must be set correctly to link the subform to the main form.
4) Click 'Design'. (The selected form appears in Design view, and the floating Toolbox appears.)
5) Do one of the following:
a) To create a new subform to add to the main form, do the following:
1] Click 'Subform/Subreport' on the Toolbox.
2] Position the mouse pointer on the form to select the location for the subform.
3] Click the location for the subform on the form. (The Subform/Subreport Wizard appears.)
4] Select the 'Table/Query' radio button to create a new subform.
Subform Wizard Step1
5] Click 'Next'. (The next step of the wizard appears.)
6] Select the desired table or query from the 'Tables and Queries' drop-down list.
NOTE: The table or query must have joining fields already established for linking.
7] Select the desired field to appear on the form from the 'Available Fields' list box.
8] Click the '>' button to add the field to the 'Selected Fields' list box.
9] Repeat steps 5)a)7] and 5)a)8] for each additional field to be added to the subform.
NOTE: Click the '>' button to add all fields in the 'Available Fields' list at one time.
10] Click 'Next'. (The next step of the wizard appears.)
11] Select the 'Choose from a list' radio button for linking the fields in the main form and subform.
12] Select the desired linking fields from the 'Select one of these links' list box.
Subform Wizard Step2
13] Click 'Next'. (The next step of the wizard appears.)
14] Type the desired name for the subform.
NOTE: This name will appear in the 'Forms' tab in the Database window.
15] Click 'Finish'. (The subform appears in Design view.)
b) To add an existing form to the current main form, do the following:
1] Click 'Subform/Subreport' on the Toolbox.
2] Position the mouse pointer on the form to select the location for the subform.
3] Click on the location for the subform on the form. (The Subform/Subreport Wizard appears.)
4] Select the 'Forms' radio button.
5] Select the existing form name from the drop-down list.
Subform Wizard Step1 Existing
6] Click 'Next'. (The next step of the wizard appears.)
NOTE: An error message will appear if an incorrect form is selected.
7] Select the 'Choose from a list' radio button for linking the fields in the main form and subform.
8] Select the desired linking fields from the 'Select one of these links' list box.
Subform Wizard Step2
9] Click 'Next'. (The next step of the wizard appears.)
10] Type the desired name for the subform.
NOTE: This name will appear in the 'Forms' tab in the Database window.
11] Click 'Finish'. (The subform appears in Design view.)
12] Select the 'File' menu and select 'Save' to save the form.
13] Select the 'View' menu and select 'Form'.
6) Select the 'File' menu and select 'Save' to save the form.
7) Select the 'View' menu and select 'Form'.